﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="VTV.TaskManagementSystem.WebApp.Admin.Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <ext:XScript runat="server">
        <script>
            var addTab = function (tabPanel, id, title, url, menuItem) {
                var tab = tabPanel.getComponent(id);

                if (!tab) {
                    tab = tabPanel.add({ 
                        id       : id, 
                        title    : title, 
                        closable : true,
                        bodypadding : 6,
                        loader   : {
                            url      : url,
                            renderer : "frame",
                            loadMask : {
                                showMask : true,
                                msg      : "Loading " + url + "..."
                            }
                        }
                    });

                    tab.on("activate", function (tab) {
                        #{menuPanel}.setSelection(tab.menuItem);
                    });
                };
            
                tabPanel.setActiveTab(tab);
            };
    </script>
    </ext:XScript>
</head>
<body>
    <form id="form1" runat="server">
        <ext:ResourceManager runat="server" ID="resourceManager" />
        <ext:Viewport runat="server"
            ID="viewPortMain"
            Layout="Border">

            <Items>
                <ext:Panel runat="server"
                    ID="pnlTop"
                    Region="North"
                    Height="40"
                    Border="false"
                    Header="False" Cls="adminHeader" BodyCls="adminHeader">

                    <Content>
                        <span style="font-size: 23px !important; display: inline-block; margin: 9px 0 0 30px !important; ">
                            HỆ THỐNG QUẢN LÝ CÔNG VIỆC - Admin Page
                        </span>
                    </Content>
                </ext:Panel>

                <ext:MenuPanel
                    ID="menuPanel"
                    runat="server"
                    Width="150"
                    Region="West"
                    Collapsible="True"
                    Title="Menu"
                    Split="True"
                    MaxWidth="200"
                    Margins="5 0 5 0">


                    <Menu runat="server"
                        ID="menu">

                        <Items>
                            <ext:MenuItem runat="server"
                                ID="menuTask"
                                Text="Công việc"
                                Icon="Report">
                                <Listeners>
                                    <Click Handler="addTab(#{tabPnlContent}, 'pnlTask', 'Công việc', 'Tasks/List.aspx', this);" />
                                </Listeners>
                            </ext:MenuItem>
                            <ext:MenuSeparator />
                            <ext:MenuItem runat="server"
                                ID="menuTeam"
                                Text="Tổ"
                                Icon="Group">
                                <Listeners>
                                    <Click Handler="addTab(#{tabPnlContent}, 'pnlTeam', 'Nhóm', 'Team/List.aspx', this);" />
                                </Listeners>
                            </ext:MenuItem>
                            <ext:MenuSeparator />
                            <ext:MenuItem runat="server"
                                ID="menuItemEmployees"
                                Text="Nhân viên"
                                Icon="UserHome">
                                <Listeners>
                                    <Click Handler="addTab(#{tabPnlContent}, 'pnlEmployees', 'Nhân viên', 'Employees/List.aspx', this);" />
                                </Listeners>
                            </ext:MenuItem>
                            <ext:MenuSeparator />
                            <%--<ext:MenuItem runat="server"
                                ID="menuUser"
                                Text="Tài khoản"
                                Icon="VcardAdd">
                            </ext:MenuItem>
                            <ext:MenuSeparator />--%>
                            <%--<ext:MenuItem runat="server"
                                ID="menuRole"
                                Text="Quyền"
                                Icon="GroupLink">
                                <Listeners>
                                    <Click Handler="addTab(#{tabPnlContent}, 'pnlRole', 'Phân Quyền', 'Role/List.aspx', this);" />
                                </Listeners>
                            </ext:MenuItem>--%>
                        </Items>
                    </Menu>
                </ext:MenuPanel>

                <ext:TabPanel
                    ID="tabPnlContent"
                    Region="Center"
                    runat="server"
                    Margins="5 5 5 0" />
            </Items>
        </ext:Viewport>
    </form>
</body>
</html>
